package me.idashu.attg.service;


import java.util.List;
import java.util.Map;

import me.idashu.attg.domain.ContextEntity;
import me.idashu.attg.persistence.ContextMapper;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service
public class ContextService {
	
	@Autowired
	private ContextMapper contextMapper;
	
	public void insertContext(ContextEntity contextEntity){
		contextMapper.insertContext(contextEntity);
	}
	
	public List<ContextEntity> findAllContexts(Map<String, Object> map){
		List<ContextEntity> contexts = contextMapper.findAllContexts(map);
		return contexts;
	}
	
	public int findCountAllContexts(ContextEntity contextEntity){
		int count = contextMapper.findCountAllContexts(contextEntity);
		return count;
	}
	
	public ContextEntity findContextById(long id){
		ContextEntity context = contextMapper.findContextById(id);
		return context;
	}
	
	public void deleteContexById(long id){
		contextMapper.deleteContexById(id);
	}
	
	public void updateContextConId(ContextEntity contextEntity){
		contextMapper.updateContextConId(contextEntity);
	}
	
	public List<ContextEntity> findContextsSeq(Map<String, Object> map){
		List<ContextEntity> contexts = contextMapper.findContextsSeq(map);
		return contexts;
	}
}
